314 research outputs found
Proof of the principal type property for system O
We study a minimal extension of the Hindley/Milner system that
supports overloading and polymorphic records.
We also show that every typable term in this system has a
principal type and give an algorithm to reconstruct that type.
We give the proofs for termination, soundness and correctness for
the constrained unification and the type reconstruction algorithm
Fighting bit Rot with Types (Experience Report: Scala Collections)
We report on our experiences in redesigning Scala\u27s collection
libraries, focussing on the role that type systems play in keeping
software architectures coherent over time. Type systems can make
software architecture more explicit but, if they are too weak, can
also cause code duplication. We show that code duplication can be
avoided using two of Scala\u27s type constructions: higher-kinded types
and implicit parameters and conversions
Type inference with constrained types
In this paper we present a general framework HM(X) for
Hindley/Milner style type systems with constraints, analogous
to the CLP(X) framework in constrained logic programming.
We present sufficient conditions on the constraint domain X
so that the principal types property carries over to HM(X).
The conditions turn out to be fairly simple and natural.
The usage of the aproach is demonstrated in instantion
of parameter X with several known type disciplines.
We consider extensible records, typeclasses, overloading
and subtyping
A second look at overloading
We study a minimal extension of the Hindley/Milner system that
supports overloading and polymorphic records. We show that the type
system is sound with respect to a standard untyped compositional
semantics. We also show that every typable term in this system has a
principal type and give an algorithm to reconstruct that type
A second look at overloading
We study a minimal extension of the Hindley/Milner system that
supports overloading and polymorphic records. We show that the type
system is sound with respect to a standard untyped compositional
semantics. We also show that every typable term in this system has a
principal type and give an algorithm to reconstruct that type
Degrees of Separation: A Flexible Type System for Data Race Prevention
Data race is a notorious problem in parallel programming. There has been
great research interest in type systems that statically prevent data races.
Despite the progress in the safety and usability of these systems, lots of
existing approaches enforce strict anti-aliasing principles to prevent data
races. The adoption of them is often intrusive, in the sense that it
invalidates common programming patterns and requires paradigm shifts. We
propose Capture Separation Calculus (System CSC), a calculus based on Capture
Calculus (System CC<:box), that achieves static data race freedom while being
non-intrusive. It allows aliasing in general to permit common programming
patterns, but tracks aliasing and controls them when that is necessary to
prevent data races. We study the formal properties of System CSC by
establishing its type safety and data race freedom. Notably, we establish the
data race freedom property by proving the confluence of its reduction
semantics. To validate the usability of the calculus, we implement it as an
extension to the Scala 3 compiler, and use it to type-check the examples
- …